package com.example.leo.mycharmingstudent.project.maintabfragment.subpagefragment.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import com.example.leo.mycharmingstudent.project.maintabfragment.subpagefragment.SubPageListFragment;

import java.util.List;

/**
 * Created by Leo on 2020/10/8.
 */

public class SubPageFragmentStateAdapter extends FragmentStatePagerAdapter {
    private List<SubPageListFragment> mSubPageList;

    public SubPageFragmentStateAdapter(
            FragmentManager fm,
            List<SubPageListFragment> subPageList) {
        super(fm);
        this.mSubPageList = subPageList;
    }

    @Override
    public Fragment getItem(int i) {
        return mSubPageList.get(i);
    }

    @Override
    public int getCount() {
        return mSubPageList.size();
    }
}
